<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderProductSelectionProposal extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_order_product_selection_proposal', function (Blueprint $table) {
            $table->id();

            $table->string('workOrderNo', 32)->default('')->comment('工单号');
            $table->unsignedInteger('shopId')->default(0)->comment('门店id');
            $table->unsignedTinyInteger('type')->default(1)->comment('类型 1-加盟商 2-员工');
            $table->unsignedTinyInteger('status')->default(1)->comment('采纳状态 1-评审中 2-已采纳 3-未采纳 4-上线 5-爆品');
            $table->unsignedTinyInteger('dealStatus')->default(1)->comment('处理状态 1-未回复 2-已回复');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0);

            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '选品建议表';

            $table->index('workOrderNo', 'idx_workOrderNo');
            $table->index('shopId', 'idx_shopId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_order_product_selection_proposal');
    }
}
